﻿@{
    ViewBag.Title = "Index";
}

@this.Partial("Item_js")
<style type="text/css">
    .img_thum {
        width: 100px;
        margin-right: 5px;
    }

    .img_red {
        border: 1px solid #ff6a00;
    }

    .tr1 {
        background-color: #dedede;
    }

    .td1 {
        width: 25%;
        text-align: right;
    }

    .td2 {
        width: 75%;
        text-align: left;
    }
    #container {
        min-width: 600px;
        min-height: 767px;
    }
</style>
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=7QSBZ-HT432-G7FUO-C7PNE-DIDNT-6MBUH"></script>
<script>
    function init()
    {
        var x = @ViewBag.shop.GPS_X;
        var y = @ViewBag.shop.GPS_Y;
        var title = "@Html.Raw(ViewBag.shop.ShopName)";

        var x1 =@ViewBag.address.GPS_X;
        var y1 =@ViewBag.address.GPS_Y;
        var title1 = "@Html.Raw(ViewBag.address.UserName)";

        var pay_sort = "@ViewBag.order.PaySort";
        if (pay_sort == 1) {
            $("#pay_sort").html("余额支付");
        }
        else {
            $("#pay_sort").html("微信支付");
        }
        
        var center = new qq.maps.LatLng(y, x);
        var map = new qq.maps.Map(document.getElementById("container"), {
            center: center,
            zoom: 15
        });
        var infoWin = new qq.maps.InfoWindow({
            map: map
        });

        var latlngs = new Array();
        var tit = new Array();
        if (x > 0 && y > 0 && title != "")
        {
            latlngs.push(new qq.maps.LatLng(y, x));
            tit.push(title);
        }
        if (x1 > 0 && y1 > 0 && title1!="")
        {
            latlngs.push(new qq.maps.LatLng(y1, x1));
            tit.push(title1);
        }
        
        for (var i = 0; i < latlngs.length; i++) {
            (function (n) {
                var marker = new qq.maps.Marker({
                    position: latlngs[n],
                    map: map
                });
                qq.maps.event.addListener(marker, 'click', function () {
                    infoWin.open();
                    infoWin.setContent(tit[n]);
                    infoWin.setPosition(latlngs[n]);
                });
            })(i);
        }
    }
    jQuery(document).ready(function () {
        init();
    });
</script>
<div style="width:100%;">
    <div class="topPanel">
        <div class="toolbar">
            <a class="a-btn-refresh" onclick="$ace.reload()"></a>
            <!--<button class="a-btn-edit" data-bind="click:edit,disable:!dataTable.selectedModel()">修改</button>
    <button class="a-btn-add" data-bind="click:add">添加</button>
    <button class="a-btn-delete" data-bind="click:del,disable:!dataTable.selectedModel()">删除</button>-->
            <button class="a-btn-info" data-bind="click:Refund">退款</button>
            <button class="a-btn-info" onclick="window.location.href='/Wiki/ShopOrder/Index'">返回</button>
        </div>

    </div>


    <div style="width:40%;float:left;">
        <div style="height:30px;width:100%;background-color:#dedede;line-height:30px;padding-left:30px;"> 基本信息</div>
        <table class="table table-hover" style="width:100%;float:left;">
            <tr>
                <td class="td1">订单编号：</td>
                <td class="td2">@ViewBag.order.OrderCode</td>
            </tr>
            <tr>
                <td class="td1">订单状态：</td>
                <td class="td2">@ViewBag.OrderStatuName</td>
            </tr>
            <tr>
                <td class="td1">订单金额：</td>
                <td class="td2">@ViewBag.order.Total</td>
            </tr>
            <tr>
                <td class="td1">商品金额：</td>
                <td class="td2">@ViewBag.order.ProTotal</td>
            </tr>
            <tr>
                <td class="td1">配送费：</td>
                <td class="td2">@ViewBag.order.Freight</td>
            </tr>
            <tr>
                <td class="td1">下单时间：</td>
                <td class="td2">@ViewBag.order.CreateDate</td>
            </tr>
            <tr>
                <td class="td1">@ViewBag.order.express_name：</td>
                <td class="td2">@ViewBag.order.express_code</td>
            </tr>
            <tr>
                <td class="td1">备注：</td>
                <td class="td2">@ViewBag.order.remark</td>
            </tr>
            <tr>
                <td class="td1">支付单号：</td>
                <td class="td2">@ViewBag.order.transaction_id</td>
            </tr>
            <tr>
                <td class="td1">退款单号：</td>
                <td class="td2">@ViewBag.order.out_refund_no</td>
            </tr>

            <tr>
                <td class="td1">支付方式：</td>
                <td class="td2" id="pay_sort"></td>
            </tr>
            <tr>
                <td class="td1">支付账单编号：</td>
                <td class="td2">@ViewBag.order.ChargeCode</td>
            </tr>


        </table>
        <div style="height:30px;width:100%;background-color:#dedede;line-height:30px;padding-left:30px;float:left;"> 商品信息</div>
        <table class="table table-hover" style="width:100%;float:left;" data-bind="with:dataTable">
            <thead>
                <tr>
                    <th>产品名称</th>
                    <th>品牌</th>
                    <th>数量</th>
                    <th>价格</th>
                </tr>
            </thead>
            <tbody data-bind="foreach:models">
                <tr data-bind="click:$parent.selectRow">
                    <td data-bind="text:ProductName"></td>
                    <td data-bind="text:BrandName"></td>
                    <td data-bind="text:ItemNum"></td>
                    <td data-bind="text:Price"></td>
                </tr>
            </tbody>
        </table>
        <div style="height:30px;width:100%;background-color:#dedede;line-height:30px;padding-left:30px;float:left;"> 客户信息</div>
        <table class="table table-hover" style="width:100%;float:left;">
            <tr>
                <td class="td1">客户姓名：</td>
                <td class="td2">@ViewBag.users.UserName</td>
               
            </tr>
            <tr>
               
                <td class="td1">客户手机：</td>
                <td class="td2">@ViewBag.users.Mobile</td>
            </tr>
        </table>
        <div style="height:30px;width:100%;background-color:#dedede;line-height:30px;padding-left:30px;float:left;"> 收货人信息</div>
        <table class="table table-hover" style="width:100%;float:left;">
            <tr>
                <td class="td1">姓名：</td>
                <td class="td2">@ViewBag.address.UserName</td>
            </tr>
            <tr>
                <td class="td1">客户手机：</td>
                <td class="td2">@ViewBag.address.Mobile</td>
            </tr>
            <tr>
                <td class="td1">地址：</td>
                <td class="td2">@ViewBag.address.Address</td>
            </tr>
        </table>
        <div style="height:30px;width:100%;background-color:#dedede;line-height:30px;padding-left:30px;float:left;">商家信息</div>
        <table class="table table-hover" style="width:100%;float:left;">
            <tr>
                <td class="td1">商家：</td>
                <td class="td2">@ViewBag.shop.ShopName</td>
            </tr>
            <tr>
                <td class="td1">商家电话：</td>
                <td class="td2">@ViewBag.shop.ShopTel</td>
            </tr>
            <tr>
                <td class="td1">地址：</td>
                <td class="td2">@ViewBag.shop.ShopAddress</td>
            </tr>
        </table>
    </div>
</div>
<div style="width:60%;float:left;" id="container">
  
</div>

<dialogbox data-bind="with:dialog">
    <form id="form1">
        <table class="form-table">
            <tr>
                <td class="form-title">订货金额</td>
                <td class="form-value">
                    <input name="Total" id="Total" disabled type="text" class="a-control required" placeholder="" data-bind="value:model().Total" />
                </td>
            </tr>
            <tr>
                <td class="form-title">订货人</td>
                <td class="form-value">
                    <input name="CreateID" id="CreateID" disabled type="text" class="a-control required" placeholder="" data-bind="value:model().CreateID" />
                </td>
            </tr>
            <tr>
                <td class="form-title">审核人</td>
                <td class="form-value">
                    <input name="AuthID" disabled id="AuthID" type="text" class="a-control required" data-bind="value:model().AuthID" />
                </td>
            </tr>

            <tr>
                <td class="form-title">店铺名称</td>
                <td class="form-value">
                    <select class="a-control" disabled name="ShopID" id="ShopID" data-bind="options:_shops,optionsText:'ShopName',optionsValue:'ShopID',optionsCaption:'--选择店铺--',value:model().ShopID">
                        <option value="0">--选择分类--</option>
                    </select>
                </td>
            </tr>


        </table>
    </form>
</dialogbox>

